{layout name="/base"}
  <div id="page-wrapper">
    <div class="row">
      <div class="col-lg-12">
        <h1>卡管理 <small>卡信息</small></h1>
        <ol class="breadcrumb">
          <li><a href="/manager/index"><i class="fa fa-dashboard"></i> 管理首页</a></li>
          <li class="active"><i class="fa fa-table"></i> 卡信息列表</li>
        </ol>
        <div class="alert alert-success alert-dismissable">
          <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
          查看卡信息 
        </div>
      </div>
    </div>
    <!-- /.row -->
    <div class="row">
      <div class="col-lg-12">
      <form class="form-horizontal" role="form" action="/caravans/cardlist" method="get">
        <div class="form-group col-sm-2" style="margin-right:10px;">
            <label for="">请选择搜索条件</label>
            <select class="form-control" name="searchfield">
              {if(input('get.searchfield') == 'card_num')}
              <option selected value="card_num">卡号</option>
              {else/}
              <option value="card_num">卡号</option>
              {/if}
              {if(input('get.searchfield') == 'name')}
              <option selected value="contract_num">合同号</option>
              {else/}
              <option value="contract_num">合同号</option>
              {/if}
              {if(input('get.searchfield') == 'user_phone')}
              <option selected value="user_phone">手机号</option>
              {else/}
              <option value="user_phone">手机号</option>
              {/if}
            </select>
          </div>
          <div class="form-group col-sm-2 input-group">  
            <label for="">请输入关键字</label>
            <input class="form-control" type="text" value="{:input('get.keyword')}" placeholder="请输入搜索信息" name="keyword">
            <label for="">&nbsp;</label>
            <span class="input-group-btn">
              <button class="btn btn-default" type="submit">搜索</button>
            </span>
          </div>
          <div class="clearfix"></div>
      </form>  
        <div class="table-responsive">
          <table class="table table-bordered table-hover table-striped tablesorter">
            <thead>
              <tr>
                <th>卡号</th>
                <th>合同号</th>
                <th>营地名称</th>
                <th>泊位号</th>
                <th>房车编号</th>
                <th>手机号码</th>
                <th>生成时间</th>
                <th>激活状态</th>
                <th>操作</th>
              </tr>
            </thead>
            <tbody>
            {volist name='card_list' id='vo'}
              <tr>
                <td>{$vo.card_num}</td>
                <td>{$vo.contract_num}</td>
                <td>{$vo.caravans.camps.name}</td>
                <td>{$vo.caravans.park_num}</td>
                <td>{$vo.caravans.number}</td>
                <td>{$vo.user_phone}</td>
                <td>{$vo.created_at}</td>
                <td>{$vo.status}</td>
                <td><a href="/caravans/cardinfo?id={$vo.id}">查看详情</a> </td>
              </tr>
            {/volist} 
            </tbody>
          </table>
        </div>   
      </div>
      <div class="col-sm-12">
      </div>
    </div>
    <!-- /.row -->
    <div class="row">
    </div>
  </div><!-- /#page-wrapper -->
